Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum


  

PreviousPrevious NextNext


~Dean Chulumar 27.Jan.04 03:41 PM a Web browser
Applications Development All Releases All Platforms


I have been looking at the MS Access ODBC export posted in Sandbox, but can not get the code to work. Has anyone got any ideas where I am going wrong. I have added a ODBC entry and tested it using other software. But I cannot get a connection using this code:

Dim con As New ODBCConnection
Dim qry As New ODBCQuery
Dim result As New ODBCResultSet
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = workspace.CurrentDocument
Set qry.Connection = con
Set result.Query = qry
Set session = New NotesSession
Set db = session.CurrentDatabase
Set view = db.GetView("addtoaccess")
'connects to the database
con.ConnectTo("stockcode")

'queries the table Contacts.
qry.SQL = "SELECT * FROM STOCKCODES"

'result is what temp stores the value and is pointing to the execute command.
result.Execute

Set doc = view.GetFirstDocument
While Not(doc Is Nothing)

'If the value is empty then get the next document else get the document that you are pointing at.
If result.IsValueNull(uidoc.CurrentField) Then
Set doc = view.GetNextDocument(doc)

'update the value and adds it to the row
result.AddRow
Call result.SetValue("STOCKCODE",doc.STOCKCODE(0))
Call result.SetValue("DESCRIPTION",doc.DESCRIPTION(0))
Call result.SetValue("CAT",doc.CAT(0))
Call result.SetValue("DATE_ENTER",doc.DATE_ENTER(0))
Call result.SetValue("OLDNO",doc.OLDNO(0))
Call result.SetValue("SIZE",doc.SIZE(0))
result.UpdateRow
Set doc = view.GetNextDocument(doc)
Else
result.AddRow
Call result.SetValue("STOCKCODE",doc.STOCKCODE(0))
Call result.SetValue("DESCRIPTION",doc.DESCRIPTION(0))
Call result.SetValue("CAT",doc.CAT(0))
Call result.SetValue("DATE_ENTER",doc.DATE_ENTER(0))
Call result.SetValue("OLDNO",doc.OLDNO(0))
Call result.SetValue("SIZE",doc.SIZE(0))
result.UpdateRow
Set doc = view.GetNextDocument(doc)
End If
Wend
result.Close(DB_CLOSE)
con.Disconnect







Exporting to MS Access (~Dean Chulumar 27.Jan.04)
. . RE: Exporting to MS Access (~Lily Nonwether... 27.Jan.04)
. . RE: Exporting to MS Access (~Chloe Dwogerok... 28.Jan.04)





  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Category
Platform
Release
Advanced search

 RSS feedsRSS
All forum posts RSS
All main topics RSS